from operator import itemgetter

oldArr=[1,2,3,4,5,6,7,8,9,10]
newArr=[]

def GetEvenNum(arr):
    """
    获取偶数
    :param arr:
    :return:
    """
    global  newArr
    for item in arr:
         if item%2==0:
             newArr.append(item)

def GetOddNum(arr):
    """
     获取奇数
    :param arr:
    :return:
    """
    item=0
    global  newArr
    while item<len(arr):
        if arr[item]%2==1:
            newArr.append(arr[item])
        item+=1



# GetEvenNum(oldArr)
GetOddNum(oldArr)
print(newArr)
